package org.kaer.election.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import org.kaer.election.ui.MainActivity;
import org.kaer.election.utils.LogUtils;

/**
 * Created by lizj on 2016/8/19.
 */
public class BootReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        LogUtils.i("广播接收者BootReceiver "+intent.getAction());
        if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
            Intent i = new Intent(context, MainActivity.class);
            i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(i);
        }
    }
}
